within ThreeD_MBS_Dynamics.Examples.Snakeboard;

model Rotor
  extends RigidBodyEnergized;
  parameter SI.Acceleration[3] Gravity;
  // Disc radius
  parameter SI.Radius r3;
  parameter SI.Length HR;
  VisualShape Rotor(
    r0={0,-HR/2,0},
    Shape="cylinder",
    LengthDirection={0,1,0},
    WidthDirection={1,0,0},
    Length=HR,
    Width=2*r3,
    Height=2*r3,
    Material={0.5,0.8,1,0.2});
  VisualShape Rod(
    r0={0,0,0.02},
    Shape="box",
    LengthDirection={1,0,0},
    WidthDirection={0,0,1},
    Length=r3 - 0.05,
    Width=0.02,
    Height=HR + 0.05,
    Material={0.5,0.5,1,0.5});
  WrenchPort InPort annotation (extent=[-10, 80; 10, 100]);
equation
  Rotor.S = T;
  Rotor.r = r;
  Rod.S = T;
  Rod.r = r;
  F = m*Gravity + InPort.F;
  M = InPort.M + cross(InPort.P - r, InPort.F);
  annotation (Diagram);
end Rotor;
